package model;

import java.net.InetAddress;
import java.net.UnknownHostException;

/**
 * This class allows us to store the informations of the local user
 */
public final class LocalUser {

	private String username;
	private InetAddress ip;

	/**
	 * the ip is the address of its computer, so localhost
	 * @param username is the username of the local user
	 */
	public LocalUser(String username) {
		this.username = username;
        try {this.ip = InetAddress.getLocalHost();} 
        catch (UnknownHostException e) {System.out.println("UnknownHostException");}
    }
	
	/**
	 * @return the local user's username
	 */
	public String getUsername() {
		return username;
	}
	
	/**
	 * @param username sets the local user's username
	 */
	public void setUsername(String username) {
		this.username = username;
	}
}
